<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>paixu</title>
	<script type="text/javascript">
	var arr=[10,75,44,32,30,7];
	  function paixu(arr){
	  	for(j=0;j<arr.length;j++){
	  		if(arr[j]>arr[j+1]){
	  			var swap=arr[j+1];
	  			arr[j+1]=arr[j];
	  			arr[j]=swap;
	  		}
	  	}


	  }
	  function sort(elements){
 for(var i=0;i<elements.length-1;i++){
  for(var j=0;j<elements.length-i-1;j++){
   if(elements[j]>elements[j+1]){
    var swap=elements[j];
    elements[j]=elements[j+1];
    elements[j+1]=swap;
   }
  }
 }
}
 
var elements = [3, 1, 5, 7, 2, 4, 9, 6, 10, 8];
console.log('before: ' + elements);
sort(elements);
console.log(' after: ' + elements);
	  var newarr=paixu(arr);
	  alert(newarr);
	</script>
</head>
<body>
	
</body>
</html>